<admintpl file="header" />
<style type="text/css">
    .imgdiv{display:inline-block; width:90px; height:90px; border:1px solid #ccc;}
	.imgdiv>img{width:100%; height: 100%}
    #fileupload {position: absolute;opacity: 0;cursor: pointer;top: 0;z-index: 1;}
    .LOGO_BTN{position: relative;display: inline-block;width:100px;background: #7e7e7e;color: #E4c217;border-radius: 4px;line-height: 26px;margin-top:10px }
	.error-info{font-size: 13px;color: red;}
	.sucess-info{font-size: 13px;color: green;}
	a{ cursor: pointer}
	.add-input{font-size:14px;text-decoration:none;margin-top: 5px;}
	.add-input:hover{
		text-decoration:none;
	}
	.system-config{
		margin-top: 10px;
	}
	
</style>
	<script src="__PUBLIC__/js/upload/jquery.ui.widget.js"></script>
    <script src="__PUBLIC__/js/upload/jquery.iframe-transport.js"></script>
    <script src="__PUBLIC__/js/upload/jquery.fileupload.js"></script>
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('SystemConfig/index')}">配置列表</a></li>
			<li class="active"><a href="{:U('SystemConfig/add')}">添加配置</a></li>
		</ul>
		<form id="event-form" method="post" class="form-horizontal js-ajax-form" action="{:U('SystemConfig/add')}">
		
				<div class="control-group">
					<label class="control-label">配置名称</label>
					<div class="controls">
						<input type="text" name="name" required="required">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">字段名称</label>
					<div class="controls">
						<input type="text" name="field" required="required">
					</div>
				</div>
				<div class="control-group" id="system-config-list">
					<label class="control-label">配置列表</label>
					<div class="controls">
						<input  type="text" placeholder="请输入键" name="key[]" required="required">：
                        <input type="text"  placeholder="请输入值" name="value[]" required="required">
						&nbsp; <a class="add-input">添加</a>&nbsp;|&nbsp;<a class="delete-input">删除</a>
					</div>
				
				</div>
				
			<div class="form-actions">
				<button id="event-add" type="submit" class="btn btn-primary js-ajax-submit">{:L('ADD')}</button>
				<a class="btn" href="javascript:history.back(-1);">{:L('BACK')}</a>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
<script type="text/javascript">
    var html = '<div class="controls system-config"><input  type="text" placeholder="请输入键" name="key[]" required="required">： <input type="text"  placeholder="请输入值" name="value[]" required="required"></div>';
    $(".add-input").click(function(){
    	$("#system-config-list").append(html);
    })

    $(".delete-input").click(function(){
    	var length = $(".system-config").length;
    	$('.system-config').eq(length-1).remove();
    })
</script>
</html>